package com.woniu.service.impl;

import com.woniu.dao.ComplainMapper;
import com.woniu.dto.ComplainDTO;
import com.woniu.service.ComplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComplainServiceImpl implements ComplainService {

    @Autowired
    private ComplainMapper complainMapper;

    @Override
    public List<ComplainDTO> findByPage(Integer currentPage, Integer pageSize) {
         List<ComplainDTO> list=complainMapper.findByPage(currentPage,pageSize);
         return list;
    }

    @Override
    public void addReply(ComplainDTO complainDTO) {
        String context=complainDTO.getContext();
        Integer id=complainDTO.getId();
        complainMapper.addReply(id,context);
    }

    @Override
    public ComplainDTO findById(Integer id) {
        ComplainDTO complainDTO= complainMapper.findById(id);
        return complainDTO;
    }

    @Override
    public List<ComplainDTO> select(String userName, Integer status) {
        List list=complainMapper.select(userName,status);
        return list;
    }
}
